﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Tycho.Parser.GrammarExplorer {
    /// <summary>
    /// Interaction logic for Window2.xaml
    /// </summary>
    public partial class Window2 : Window {
        public Window2 () {
            InitializeComponent ();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            TextPointer docStart = richTextBox1.Document.ContentStart;
            TextPointer start = docStart.GetPositionAtOffset (4);
            TextPointer end = docStart.GetPositionAtOffset (8);

            var s = new Span (start, end);
            s.Background = Brushes.YellowGreen;
        }
    }
}
